<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" session="false" %>
<html>
<head>
    <title>新增权限资源</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
	<script src="${pageContext.request.contextPath}/static/plugins/jqGrid/js/minified/jquery.jqGrid.min.js"></script>
	<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/jquery.form.js"></script>
</head>
<body>
<div class="col-sm-12">
    <form class="form-horizontal m-t" id="form" method="post"
          action="${pageContext.request.contextPath}/admin/auth_add.action">
        <input type="hidden" name="mPno" value="${mPno}">
        <input type="hidden" name="mLevel" value="${mLevel}">
        <c:if test="${!empty mPno}">
            <div class="form-group">
                <label class="col-sm-3  control-label">上级资源:</label>
                <div class="col-sm-8">
                    <input class="form-control" readonly value="${mName}"/>
                </div>
            </div>
        </c:if>
        <div class="form-group">
            <label class="col-sm-3  control-label"><i class="require">*</i>资源描述:</label>
            <div class="col-sm-8">
                <input class="form-control" name="mName" size="30"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3  control-label"><i class="require">*</i>备注名称:</label>
            <div class="col-sm-8">
                <input class="form-control" name="mcname" size="30"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3  control-label">资源图标:</label>
            <div class="col-sm-8">
                <input class="form-control" name="mIcon" size="30"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3  control-label"><i class="require">*</i>菜单类型:</label>
            <div class="col-sm-8">
                <select name="type" id="type" class="form-control" onchange="typeChange()">
                    <option value="0">系统菜单</option>
                    <option value="1">APP积分</option>
                </select>
            </div>
        </div>
        <div class="form-group" id="mTypeDiv">
            <label class="col-sm-3  control-label"><i class="require">*</i>资源类型:</label>
            <div class="col-sm-8">
                <select name="mType" id="mType" class="form-control">
                    <option value="1">模块</option>
                    <option value="2">菜单</option>
                    <option value="3">原子菜单</option>
                    <option value="4">按钮</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3  control-label">资源url:</label>
            <div class="col-sm-8">
                <input class="form-control" name="mUrl" size="30"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3  control-label"><i class="require">*</i>排序:</label>
            <div class="col-sm-8">
                <input class="form-control" name="mSort" size="30"/>
            </div>
        </div>
    </form>
</div>
<script>
function typeChange() {
	var select = $("#type").val();
	if(select == 0){
		$("#mTypeDiv").attr("style","");
	}else{
		$("#mTypeDiv").attr("style","display:none");
		$("#mType").val('2');
	}
}
</script>
</body>
</html>
